// 该文件专门用于创建整个应用的路由器
import Vue from 'vue'
import VueRouter from 'vue-router'
//引入组件


Vue.use(VueRouter)

// 创建一个路由器(内容为路由表)
const routes = [{
        path: '/order',
        name: 'order',
        component: () =>
            import ('../views/Order.vue')
    },
    {
        path: '/index',
        name: 'index',
        component: () =>
            import ('../views/Index.vue')
    }, {
        path: '/mine',
        name: 'mine',
        component: () =>
            import ('../views/Mine.vue')
    }, {
        path: '/bao',
        name: 'bao',
        component: () =>
            import ('../views/Bao.vue'),
        // children: [{
        //         path: '/Bao/ing',
        //         name: 'ing',
        //         component: () =>
        //             import ('../views/Bao/ing.vue'),
        // children: [{
        //     path: '/Bao/ing/mess',
        //     name: 'mess',
        //     component: () =>
        //         import ('../views/Bao/mess.vue'),
        // }]
        // },
        // {
        //     path: '/Bao/news',
        //     name: 'news',
        //     component: () =>
        //         import ('../views/Bao/news.vue'),

        // },
        // ]
    }, {
        path: '/',
        redirect: '/index',
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router